package reliability.types.graph;

public class NetworkElement
{
    private static final double EPSILON = 1E-8;
    private double reliability;

    public NetworkElement(double reliability)
    {
        this.reliability = reliability;
    }

    public double getReliability()
    {
        return reliability;
    }

    public void setReliability(double reliability)
    {
        this.reliability = reliability;
    }

    public boolean getState(double possibility)
    {
        return lessOrEquals(possibility, reliability);
    }

    private boolean lessOrEquals(double firstArg, double secondArg)
    {
        return firstArg - secondArg < -EPSILON;
    }

}
